import Vue from 'vue'
import Vuex from 'vuex'
import son from './modules/son'
import { getToken } from "@/utils/storage";
import createVuexPersisted from 'vuex-persistedstate'    
Vue.use(Vuex)
export default new Vuex.Store({
  state: {
    token: getToken() || ''
  },
  getters: {
  },
  mutations: {
  },
  actions: {
  },
  modules: {
    son
  },
  plugins: [
    createVuexPersisted({
      reducer(val) {
        return {
          token: val.son.token
        }
      }
    })
  ]
})